package com.zsgl.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zsgl.service.HotelService;

@Controller
public class HotelController {
	
	private HotelService hotelService;

	@Autowired
	public HotelController(HotelService hotelService) {
		this.hotelService = hotelService;
	}
	
	@RequestMapping("/hotel")
	public void index() {
		
	}
	
	@RequestMapping("/hotel/view/{id}")
	public void view(@PathVariable long id, Model model) {
		model.addAttribute("hotel", hotelService.find(id));
	}
	
}
